package com.my.admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.my.admin.entity.Comment;
import com.my.admin.mapper.CommentMapper;
import com.my.admin.service.CommentService;
import com.my.admin.util.ServiceImplCache;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl extends ServiceImplCache<CommentMapper, Comment> implements CommentService {

    @Override
    @Cacheable(value = "getList")
    public IPage<Comment> getList(IPage<Comment> page, Comment comment) {
        return baseMapper.getList(page, comment);
    }

    @Override
    @Cacheable(value = "getByArticleId")
    public List<Comment> getByArticleId(Long articleId) {
        return baseMapper.getByArticleId(articleId);
    }


}
